﻿using System;

namespace ConsoleApp
{
    class Program
    {
        public static void Main(string[] args)
        { 
        Random ran = new Random();
        Shape[] shapes=new Shape[10];
       
        for (int i = 0; i < 10; i++) 
            { 
                int x = ran.Next(1, 4);
                int a = ran.Next(0, 100);
                int b=ran.Next(0,100);
                //取一个1~3的随机数
                switch(x)
                {
                    case 1:
                        shapes[i] = new Circle(a);
                        break;
                    case 2:
                        shapes[i] = new Rectangle(a,b);
                        break;
                    case 3:
                        shapes[i] = new Square(a);
                        break;
                    default:
                        break;
                }
            }
        foreach (Shape shape in shapes)
            {
                shape.draw();
                Console.WriteLine("面积为"+shape.culculateArea());
                Console.WriteLine();
            }
        }
    }
}